/*
 * Image Search App - styles.css
 * Clean, responsive styles for the Image Search demo
 */

:root {
  --bg: #0f1724;
  --card: rgba(255,255,255,0.04);
  --accent: #7c3aed;
  --muted: rgba(255,255,255,0.7);
  --gap: 1.5rem;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial;
}

* { box-sizing: border-box; }
html,body { height: 100%; margin: 0; }
body {
  background: linear-gradient(180deg, #071029 0%, #0f1724 100%);
  color: #fff;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
}

.container {
  max-width: 1100px;
  margin: 2rem auto;
  padding: 1.25rem;
}

.header {
  text-align: center;
  margin-bottom: 2rem;
}
.title { font-size: 2rem; margin: 0 0 .25rem 0; }
.subtitle { margin: 0; color: var(--muted); font-size: 0.95rem; }

.search-container { margin-top: 1.25rem; display:flex; justify-content:center; }
.search-wrapper {
  display:flex; align-items:center; gap:.5rem; background:var(--card); padding:.5rem; border-radius:999px; width:100%; max-width:720px;
}
.search-input { flex:1; border:0; outline:none; background:transparent; color:inherit; padding:.6rem .75rem; font-size:1rem; }
.search-button {
  background: linear-gradient(90deg,var(--accent), #5b21b6);
  color: white; border:0; padding:.6rem .9rem; border-radius:999px; cursor:pointer; font-weight:600;
}

.main-content { margin-top: 1.5rem; }

.loading-indicator { display:none; align-items:center; gap:1rem; color:var(--muted); }
.loading-indicator .spinner { width:28px; height:28px; border-radius:50%; border:3px solid rgba(255,255,255,0.08); border-top-color:var(--accent); animation:spin 1s linear infinite; }
@keyframes spin { to { transform:rotate(360deg); } }

.error-message, .no-results { display:none; justify-content:center; padding:2rem 1rem; background:rgba(255,255,255,0.02); border-radius:12px; }
.error-content, .no-results-content { text-align:center; color:var(--muted); }

.image-grid {
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--gap);
  margin-top: var(--gap);
}
.image-item { background:linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01)); border-radius:12px; overflow:hidden; position:relative; display:block; box-shadow: 0 6px 20px rgba(2,6,23,0.5); transition: transform .22s ease, box-shadow .22s ease; }
.image-item:hover { transform: translateY(-6px); box-shadow: 0 14px 36px rgba(12,8,46,0.6); }
.image-container { display:block; width:100%; height:220px; background:linear-gradient(180deg, rgba(0,0,0,0.05), rgba(0,0,0,0.08)); }
.image-container img { width:100%; height:100%; display:block; object-fit:cover; }

.load-more-container { display:flex; justify-content:center; margin-top:1.25rem; }
.load-more-button { background:transparent; border:1px solid rgba(255,255,255,0.06); color:var(--muted); padding:.6rem 1rem; border-radius:8px; cursor:pointer; }
.load-more-spinner { width:16px; height:16px; border-radius:50%; border:2px solid rgba(255,255,255,0.06); border-top-color:var(--accent); animation:spin 0.8s linear infinite; display:inline-block; margin-right:.5rem; vertical-align:middle; }

/* small hover for buttons */
.search-button:hover, .load-more-button:hover { filter:brightness(1.05); transform:translateY(-1px); }

.welcome-message {
  grid-column: 1 / -1; /* span full width of the grid */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  border-radius: 12px;
  margin: 0 0 1.25rem 0;
  min-height: 60vh; /* give it page-like height */
}

.welcome-message > div {
  max-width: 520px;
  width: 100%;
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(2,6,23,0.6);
}

/* image meta overlay on hover */
.image-item .meta {
  position:absolute; left:0; right:0; bottom:0; padding:.6rem .75rem; background: linear-gradient(180deg, rgba(0,0,0,0), rgba(0,0,0,0.6)); color:#fff; font-size:0.9rem; display:flex; justify-content:space-between; align-items:center; opacity:0; transform:translateY(8px); transition:opacity .22s ease, transform .22s ease;
}
.image-item:hover .meta { opacity:1; transform:translateY(0); }

/* Modal styles (basic) */
.image-modal { position:fixed; inset:0; z-index:1000; display:flex; align-items:center; justify-content:center; }
.image-modal .modal-overlay { background: rgba(0,0,0,0.85); width:100%; height:100%; display:flex; align-items:center; justify-content:center; padding:2rem; }
.image-modal .modal-content { max-width:1000px; width:100%; max-height:90vh; }
.modal-image { width:100%; height:auto; border-radius:10px; display:block; }
.modal-close { position: absolute; top:1rem; right:1rem; background:none; border:0; color:#fff; font-size:2rem; cursor:pointer; }
.modal-info { margin-top:.75rem; text-align:center; color:var(--muted); }

/* Responsive tweaks */
@media (max-width:700px) {
  .container { padding: .75rem; }
  .search-wrapper { padding:.4rem; }
  .title { font-size:1.5rem; }
}

/* Utility */
.hidden { display:none !important; }
